package ar.com.gtug.android.app;

import java.util.LinkedList;
import java.util.List;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class HomeActivity extends Activity {

	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_home);
    
        List<String> events = new LinkedList<String>();
        events.add("Evento 1");
        events.add("Evento 2");
        events.add("Evento 3");
        events.add("Evento 4");
        events.add("Evento 5");
        events.add("Evento 6");
        
        ListView lv = (ListView) findViewById(R.id.eventList);
        lv.setAdapter(new ArrayAdapter<String>(this,R.layout.event_list_item,events));
        
        final Intent web = new Intent(this, EventDetailsActivity.class);
        
        lv.setOnItemClickListener(new OnItemClickListener() {

			public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
					long arg3) {
			
				startActivity(web);
				
			}
        	
        });
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_home, menu);
        return true;
    }

    
}
